const express = require('express');
const router = express.Router()
const categoryController = require('../controllers/categoryController');
const { body } = require('express-validator');
router.post('/list', categoryController.categoryList)
router.post('/add', [
  body('category_name').notEmpty().withMessage('分类名称(category_name)不能为空'),
  body('seq').notEmpty().withMessage('排序序号(seq)不能为空'),
  body('stats').notEmpty().withMessage('启禁状态(stats)不能为空'),
], categoryController.categoryAdd)
router.post('/upd', [
  body('id').notEmpty().withMessage('分类ID(id)不能为空'),
  body('category_name').notEmpty().withMessage('分类名称(category_name)不能为空'),
  body('seq').notEmpty().withMessage('排序序号(seq)不能为空'),
  body('stats').notEmpty().withMessage('启禁状态(stats)不能为空'),
], categoryController.categoryUpd)
router.get('/detail', categoryController.categoryDetail)
// router.delete('/del', issueController.issueDele)
module.exports = router

